home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / amac40.zip / SIZE15.QM < prev    next >
Text File  |  1991-07-28  |  13KB  |  232 lines

  1. *                               SIZE15.QM, v1.5f
  2. *                      Macros To Show Byte Size of Macros
  3. *                           Written by Tom Hogshead
  4. *                                July 28, 1991
  5. *
  6. * ┌──────────────────────────────── Index)  ────────────────────────────┐
  7. * │
  8. * │ @(0)    Shows Byte Size of SINGLE Macro                         <chg
  9. * │
  10. * │ @(9)    Shows Byte Size of ALL Macros In A Txtfile              <chg
  11. * │
  12. * │         See DSIZ.QM and DSIZ.BAT for ^F6 to sort Directory
  13. * │         sizes by size (requires DX.EXE)
  14. * │
  15. * └─────────────────────────────────────────────────────────────────────┘
  16.  
  17.  
  18. * SIZE15.QM are QEdit macros to quickly show byte size of a macro
  19. * added to the end of the macro with an asterisk and space in column 1.
  20. * See the end of each of these macros for byte size. Change c: to
  21. * a ramdisk for faster operation.
  22.  
  23. * These macros require "QEdit and QMAC v2.1, February, 1990" or later.
  24.  
  25. * To BEGIN, just type "START SIZE" <Enter>. All pertinent files will be
  26. * loaded in the "Ring" for viewing, and SIZE15.MAC is read.
  27. * Alternatively, type "START SIZE 0" <Enter> and the disk copies of all
  28. * files in the "Ring" will be loaded ready for editing, saving time.
  29.  
  30. * For other macros see ALLMACRO.INF.
  31.  
  32. * 
  33. * ----------------------------------------------------------------------
  34. * @(9) Macro To Show Byte Size Of ALL Macros In A Txtfile
  35. * ----------------------------------------------------------------------
  36.  
  37. * To run, cursor may be anywhere in a txtfile. Press Alt and 9 at the
  38. * same time, and the size of each macro is added at the end of each
  39. * macro with an asterisk in column 1. Macros must be paragraphs with no
  40. * blank lines, but paragraphs need NOT contain macros.  QMACB.BAT must
  41. * be available in your path.  Word "macro_begin" (no _) must be used
  42. * only at start of macro. Key and "macro_begin" must be on same line.
  43.  
  44. @9 macrobegin
  45.         onewindow                       * Close all windows                 |f
  46.         begfile                         * Get to begin of file
  47.         unmarkblock insertline begline  * Insert temp line
  48.         dropanchor currentfilename      *
  49.         storescrbuff "9" return         * Get name to scratchbuff 9         |
  50.         cut                             * Delete temp line
  51.  NEXT:                                  * Get ready to mark
  52.         FIND "macro" "begin" return     * Find start of macro               |
  53.         "I" return                      *                                   |
  54.         jfalse END:                     * End macro if no more macros       |
  55.         begline                         * Move to <key> begin               |
  56.         altwordset                      * To make all keys a word          |b
  57.         markword                        * Mark key                         |b
  58.         defaultwordset                  * Reset for wordright below        |b
  59.         storescrbuff "7" return         * Store <key> to scratchbuff 7      |
  60.         unmarkblock                     *                                   |
  61.         markline                        * Mark start of macro               |
  62.         endpara                         * Go to end of macro                |
  63.         makectrofscreen                 * Quick look at end of macro        |
  64.         writeblock "c:#.qm" return      * Write macro block to C:#.qm     |ae
  65.         addline                         * Add blank line at end of macro    |
  66.         editfile return quit            * Quit c:#.qm file from ring
  67.         editfile return                 * Load new macro block txtfile
  68.         DOS "qmacb " currentfilename    * Make macfile of macro block
  69.         backspace backspace backspace   * Remove '.qm'
  70.         return return                   * Return from Dos
  71.         DOS "dir " currentfilename      * Get macfile size with Dir
  72.         backspace backspace             * Delete "qm"
  73.        "mac >C:!"                       * Add "mac", save list to temp
  74.         return return                   * Back from Dos
  75.         killfile quit                   * Kill/quit C:#.qm
  76.         editfile "C:!" return           * Load Dir listing of macfile
  77.         gotoline "4" return             * Drop down
  78.         wordright wordright markword    * Mark size
  79.         storescrbuff "8" return         * Get size to scratchbuff 8
  80.         killfile quit                   * Kill/quit C:!
  81.         getscrbuff "9" return           * Insert orig file name             |
  82.         cut                             * Get to scrap
  83.         editfile paste return           * Load orig file                        * edit currentfilename
  84.         prevpara endpara cursordown     * Move to blank line at macro end   |
  85.         begline                         * Begline
  86.        "*" cursorright                  * Put asterisk in column 1
  87.         getscrbuff "8" return           * Insert byte size of macro
  88.         endline cursorright "bytes"     * Add "bytes"
  89.         cursorright                     * Space
  90.         insertdate inserttime           * Insert date and time
  91.         "(TH"                           * Author ID, (change to your inits) |
  92.         cursorright                     * One space right                   |
  93.         getscrbuff "7" return           * Get macro <key>                   |
  94.         endline                         * Move to end of <key>              |
  95.         ")" cursorleft                  * Add end parenthesis               |
  96.         jump NEXT:                      * Loop again
  97.  END:                                   *
  98.         unmarkblock                     * Unmark key
  99.         begfile                         *                                   |
  100. *
  101. * 200 bytes Thu  09-13-1990  19:13:19
  102. * 201 bytes Mon  05-06-1991  14:36:44
  103. * 210 bytes Thu  05-16-1991  12:00:10 (TH @9 added author identification)
  104. * 219 bytes Mon  07-01-1991  15:01:24 (TH @9 added macro <key>)
  105. * 203 bytes Sat  07-06-1991  11:47:04 (TH @9 shortened)
  106. * 202 bytes Tue  07-16-1991  21:20:32 (TH @9 chng key mark for scan codes |b)
  107. * 201 bytes Sat  07-20-1991  09:00:24 (TH @9, removed unmarkblock |c)
  108. * 201 bytes Mon  07-22-1991  17:26:34 (TH @9, changed c:$.qm to c:#.qm |e)
  109. * 202 bytes Sun  07-28-1991  22:21:10 (TH @9, added onewindow |f)
  110.  
  111.  
  112.  
  113. * 
  114. * ----------------------------------------------------------------------
  115. * @(0) Macro To Show Byte Size of SINGLE Macro Inserted At End Of Macro
  116. * ----------------------------------------------------------------------
  117.  
  118. * Place cursor line anywhere in a txtfile macro and press @0.  Macro
  119. * size is added at the end of the macro as shown below. Macro must be a
  120. * paragraph with NO blank lines. If the paragraph does NOT contain a
  121. * macro, the macro stops executing with a beep, meaning "macro_begin"
  122. * was not found in the paragraph.  QMACB.BAT must be in path.  Word
  123. * "macro_begin" (no _) must be used only at start of macro.  Key and
  124. * "macro_begin" must be on same line.
  125.  
  126.  
  127. @0 macrobegin
  128.         onewindow                       * Close all windows                 |f
  129.         unmarkblock insertline begline  * Insert temp line
  130.         dropanchor currentfilename      *
  131.         storescrbuff "9" return         * Get name to scratchbuff 9
  132.         cut                             * Delete temp line
  133.         prevpara begline                * Go to macro begin
  134.  NEXT:                                  * Get ready to mark
  135.         markcharacter                   * Markblock begin                   |
  136.         endpara                         * Go to para end                    |f
  137.         markcharacter                   * Markblock end                     |
  138.         gotoblockbeg                    * Get to para begin
  139.         FIND "macro" "begin" return     * Check if para is macro            |
  140.         "LI" return                     *
  141.         jtrue HASMACRO:                 * If para is a macro, go to HASMACRO
  142.                                         * ELSE end macro
  143.         jump END:                       *
  144.   HASMACRO:                             * Come here if para has macro
  145.         begline                         * Move to <key> begin               |
  146.         altwordset                      * To make all keys a word          |b
  147.         markword                        * Mark key                         |b
  148.         defaultwordset                  * Reset for wordright below        |b
  149.         storescrbuff "7" return         * Store <key> to scratchbuff 7      |
  150.         markline                        * Mark start of macro               |
  151.         endpara                         * Go to end of macro                |
  152.         editfile "c:#.qm" return        *                                 |ae
  153.         killfile quit                   * Kill/quit C:#.qm                  |
  154.         makectrofscreen                 * Quick look at end of macro        |
  155.         writeblock return               * Write macro block to C:#.qm       |
  156.         addline                         * Add blank line at end of macro    |
  157.         editfile return                 * Load c:#.qm macro block txtfile
  158.         DOS "qmacb " currentfilename    * Make macfile of macro block
  159.         backspace backspace backspace   * Remove '.qm'
  160.         return return                   * Return from Dos
  161.         DOS "dir " currentfilename      * Get macfile size with Dir
  162.         backspace backspace             * Delete "qm"
  163.        "mac >C:!"                       * Add "mac", save list to temp
  164.         return return                   * Back fom DOS
  165.         killfile quit                   * Kill/quit C:#.qm
  166.         editfile "C:!" return           * Load Dir listing of macfile
  167.         gotoline "4" return             * Drop down
  168.         wordright wordright markword    * Mark size
  169.         storescrbuff "8" return         * Get size to scratchbuff 8
  170.         killfile quit                   * Kill/quit C:!
  171.         getscrbuff "9" return           * Insert orig file name
  172.         cut                             * Get to scrap
  173.         editfile paste return           * Load orig file                        * edit currentfilename
  174.         prevpara endpara cursordown     * Move to blank line at macro end   |
  175.         begline                         * Begline
  176.        "*" cursorright                  * Put asterisk in column 1
  177.         getscrbuff "8" return           * Insert byte size of macro
  178.         endline cursorright "bytes"     * Add "bytes"
  179.         cursorright                     * Space
  180.         insertdate inserttime           * Insert date and time
  181.         "(TH"                           * Author ID, (change to your inits) |
  182.         cursorright                     * One space right                   |
  183.         getscrbuff "7" return           * Get macro <key>                   |
  184.         endline                         * Move to end of <key>              |
  185.         ")" cursorleft                  * Add end parenthesis               |
  186.  END:
  187.         unmarkblock                     * Un-mark key
  188. *
  189. * 189 bytes Thu  09-13-1990  19:13:24
  190. * 190 bytes Mon  05-06-1991  15:08:09
  191. * 199 bytes Thu  05-16-1991  11:32:44 (TH @0 added author identification)
  192. * 209 bytes Mon  07-01-1991  15:01:30 (TH @0 added macro <key>)
  193. * 209 bytes Sat  07-06-1991  01:31:43 (TH @0 moved makectrofscreen up)
  194. * 208 bytes Tue  07-16-1991  21:16:56 (TH @0 chng key mark for scan codes |b)
  195. * 207 bytes Sat  07-20-1991  08:59:33 (TH @0, removed unmarkblock |c))
  196. * 207 bytes Mon  07-22-1991  17:26:40 (TH @0, changed c:$.qm to c:#.qm |e)
  197. * 208 bytes Sun  07-28-1991  22:16:17 (TH @0, added onewindow |f)
  198.  
  199.  
  200. * Version History
  201. * ---------------------------------------------------------------------
  202. *         1.0  - Initial
  203. *         1.1  - Added Alt_9 to show size of all macros in txtfile
  204. *         1.1a - Modified @9 for paragraphs that are not macros
  205. *         1.1b-  Changed other file names in series, this is an update.
  206. *         1.2 -  Changed documentation only.
  207. *             -  Changed .LST and .QL files.
  208. *         1.3 -  Modified macros slightly, @0 now checks if
  209. *                paragraph is a macro, like @9.
  210. *         1.3a - Removed [d:]\[path] for location of QMAC from QMACB.BAT
  211. *                files. QMAC can be located anywhere in path.
  212. *         1.3b - Modified documentation and added START.BAT.
  213. *         1.4  - Added reference to DSIZ.QM and DSIZ.BAT.
  214. *              - Changed @9 and @0 to unmark byte size after running.
  215. *         1.5  - Added author identification to macro size line.
  216. *         1.5a - Changed @9 and @0 to include macro <key> in size line.
  217. *         1.5b - Added makectrofscreen to and shortened @9.
  218. *              - Moved makectrofscreen up in @0. Updated comments.
  219. *         1.5c - Changed @9 and @0 to mark keys using scan codes correctly.
  220. *         1.5d - Removed unmarkblock from @9 and @0.
  221. *              - Included with AMAC39.ZIP, July 21, 1991.
  222. *         1.5e - Changed temporary file c:$.qm to c:#.qm in @9 and @0
  223. *                in order to measure byte size of macros produced with
  224. *                @6 and @7 in MACRxx.QM, July 22, 1991.
  225. *         1.5f - Minor documentation changes, 7/29/91.
  226. *              - Added onewindow to @9 and @0.
  227. *              - Changed markblockbeg/end to markcharacter in @0.
  228. *
  229. *
  230. *
  231. *
  232.